//
//  ComposeTitleView.swift
//  swift_learning
//
//  Created by arons on 2017/2/3.
//  Copyright © 2017年 arons. All rights reserved.
//

import UIKit
import SnapKit

class ComposeTitleView: UIView {
    
    lazy private var titleLabel = UILabel()
    lazy private var screenNameLabel = UILabel()

    override init(frame: CGRect) {
        super.init(frame: frame)
        
        self.initUI()
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    private func initUI() {
        titleLabel.font = UIFont.systemFont(ofSize: 16)
        titleLabel.textAlignment = .center
        self.addSubview(titleLabel)
        titleLabel.snp.makeConstraints { (make) in
            make.top.equalTo(self)
            make.centerX.equalTo(self)
        }
        
        screenNameLabel.font = UIFont.systemFont(ofSize: 12)
        screenNameLabel.textAlignment = .center
        screenNameLabel.textColor = UIColor.lightGray
        self.addSubview(screenNameLabel)
        screenNameLabel.snp.makeConstraints { (make) in
            make.top.equalTo(titleLabel.snp.bottom).offset(3)
            make.centerX.equalTo(self)
        }
        
        // 设置数据
        titleLabel.text = "发微博"
        screenNameLabel.text = UserAccountManager.sharedInstance.account?.screen_name
    }
}
